package com.meiya.hugegraph.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

/**
 * HugeGraph配置类
 * 从application.yml中加载HugeGraph相关配置
 */
@Configuration
@ConfigurationProperties(prefix = "hugegraph")
public class HugeGraphConfig {
    
    private String serverUrl;
    private String graphName;
    private int timeout = 60;
    private BatchConfig batch = new BatchConfig();
    
    public String getServerUrl() {
        return serverUrl;
    }
    
    public void setServerUrl(String serverUrl) {
        this.serverUrl = serverUrl;
    }
    
    public String getGraphName() {
        return graphName;
    }
    
    public void setGraphName(String graphName) {
        this.graphName = graphName;
    }
    
    public int getTimeout() {
        return timeout;
    }
    
    public void setTimeout(int timeout) {
        this.timeout = timeout;
    }
    
    public BatchConfig getBatch() {
        return batch;
    }
    
    public void setBatch(BatchConfig batch) {
        this.batch = batch;
    }
    
    /**
     * 批量操作相关配置
     */
    public static class BatchConfig {
        private int vertexBatchSize = 500;
        private int edgeBatchSize = 500;
        private boolean checkVertex = true;
        
        public int getVertexBatchSize() {
            return vertexBatchSize;
        }
        
        public void setVertexBatchSize(int vertexBatchSize) {
            this.vertexBatchSize = vertexBatchSize;
        }
        
        public int getEdgeBatchSize() {
            return edgeBatchSize;
        }
        
        public void setEdgeBatchSize(int edgeBatchSize) {
            this.edgeBatchSize = edgeBatchSize;
        }
        
        public boolean isCheckVertex() {
            return checkVertex;
        }
        
        public void setCheckVertex(boolean checkVertex) {
            this.checkVertex = checkVertex;
        }
    }
} 